package com.wswy.wzcx.ui.module.oilprice

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.view.View
import android.view.animation.LinearInterpolator

class CloudAnimHelper(val view:View) {

    private var anim1:Animator?=null

    fun start(){


        ObjectAnimator.ofFloat(view,View.TRANSLATION_X,0f,-100f).apply {

            duration = 3000

            repeatCount = ValueAnimator.INFINITE
            repeatMode = ValueAnimator.REVERSE

            interpolator = LinearInterpolator()

            anim1 = this

        }.start()

    }

    fun stop(){
        anim1?.cancel()
    }

}